﻿using System;
using System.ServiceModel;
using System.Collections.Generic;
using System.IO;
using Storage.RemoteStorage.Sevice.Entity;
using System.Runtime.Serialization;
using Storage.RemoteStorage.Sevice.Entity.Transfert;
namespace Storage.RemoteStorage.Sevice
{
    [ServiceContract]
    public interface IRemoteStorage
    {
        [OperationContract]
        void CloseFileContent(VirtualFile file);
        [OperationContract]
        bool CopyFolder(string Name, VirtualFolder Parent, VirtualFolder NewParent);
        [OperationContract]
        VirtualFolder CreateFolder(string name, VirtualFolder Parent);
        [OperationContract]
        bool DeleteFile(string Name, VirtualFolder Parent);
        [OperationContract(Name = "DeleteFolderObject")]
        bool DeleteFolder(VirtualFolder folder);
        [OperationContract]
        bool DeleteFolder(string Name, VirtualFolder Parent);
        [OperationContract]
        VirtualFile GetFile(string Name, VirtualFolder Parent);
        [OperationContract]
        List<VirtualFile> GetFilesPaged(int PageIndex, int PageSize, Entity.VirtualFolder Parent, out bool isEnd);
        [OperationContract]
        List<VirtualFolder> GetFolderPaged(int PageIndex, int PageSize, Entity.VirtualFolder Parent, out bool isEnd);
        [OperationContract]
        VirtualFolder GetFolder(string Name, VirtualFolder Parent);
        [OperationContract]
        VirtualFolder GetFolderbyIndex(int index, VirtualFolder Parent);
        [OperationContract]
        VirtualFolder GetFolderbyPath(string remotePath, VirtualFolder Parent,bool createifNoExist);
        [OperationContract]
        VirtualFolder GetRootFolder();
        [OperationContract(Name = "MoveFolderObject")]
        bool MoveFolder(VirtualFolder folder, VirtualFolder NewParent);
        [OperationContract]
        bool MoveFolder(string Name, VirtualFolder Parent, VirtualFolder NewParent);

        [OperationContract]
        string GetHashCode(VirtualFile Name, VirtualFolder Parent);
        [OperationContract]
        bool RenameFolder(string OldName, string NewName,VirtualFolder Parent);
        [OperationContract]
        bool RenameFile(string OldName, string NewName, VirtualFolder Parent);
        [DataMember]
        VirtualFolder RootFolder { get; }
    }
}
